home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / gms_dev.lha / GMS / Source / Asm / Fading / GreenFade.s next >
Encoding:
Text File  |  1997-07-05  |  2.8 KB  |  104 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;Name:      Green Fade
  3. ;Author:    Paul Manias
  4. ;Copyright: DreamWorld Productions © 1996-1997.  Freely distributable.
  5. ;
  6. ;Fades in a 32 colour picture, then up to a specified colour (greenish
  7. ;yellow), and then out to black.  Press left mouse button to exit.
  8.  
  9.     INCDIR    "INCLUDES:"
  10.     INCLUDE    "games/games_lib.i"
  11.     INCLUDE    "games/games.i"
  12.  
  13.     SECTION    "GreenFade",CODE
  14.  
  15. ;===========================================================================;
  16. ;                             INITIALISE DEMO
  17. ;===========================================================================;
  18.  
  19. Start:    STARTGMS
  20.  
  21.     MOVEM.L    A0-A6/D1-D7,-(SP)
  22.     move.l    GMSBase(pc),a6
  23.     lea    PicFile(pc),a1
  24.     moveq    #GETPALETTE|VIDEOMEM,d0
  25.     CALL    LoadPicFile
  26.     move.l    d0,Picture
  27.     beq.s    .Error_Picture
  28.  
  29.     move.l    Picture(pc),a1
  30.     lea    ScreenTags(pc),a0
  31.     move.l    PIC_Data(a1),GMem
  32.     CALL    ShowScreen
  33.     tst.l    d0
  34.     beq.s    .Error_Screen
  35.  
  36.     bsr.s    Main
  37.  
  38. .ReturnToDOS
  39.     move.l    GMSBase(pc),a6
  40.     move.l    Screen(pc),a0
  41.     CALL    DeleteScreen
  42. .Error_Screen
  43.     move.l    Picture(pc),a1
  44.     CALL    FreePic
  45. .Error_Picture
  46.     MOVEM.L    (SP)+,A0-A6/D1-D7
  47.     moveq    #ERR_OK,d0
  48.     rts
  49.  
  50. ;===========================================================================;
  51. ;                                MAIN CODE
  52. ;===========================================================================;
  53.  
  54. Main:    move.l    Screen(pc),a0    ;a0 = GameScreen
  55.     moveq    #$00,d0    ;d0 = FadeState
  56.     moveq    #5,d1    ;d1 = Speed of fade.
  57.     move.l    Picture(pc),a1    ;a1 = Picture structure.
  58.     move.l    PIC_Palette(a1),a1    ;a1 = Palette to fade to.
  59.     moveq    #$000000,d2    ;d2 = Fading from black.
  60.     moveq    #00,d3    ;d3 = Start colour.
  61.     move.l    GS_AmtColours(a0),d4    ;d4 = Amount of colours.
  62. .f_in    CALL    WaitVBL
  63.     CALL    ColourToPalette    ;Do the fade routine.
  64.     tst.w    d0    ;Has the fade finished yet?
  65.     bne.s    .f_in    ;If not, keep doing it.
  66.  
  67.     moveq    #2,d1    ;d1 = Speed of fade.
  68.     move.l    Picture(pc),a1    ;a1 = Picture structure.
  69.     move.l    PIC_Palette(a1),a1    ;a1 = Palette we are fading from.
  70.     move.l    #$75F343,d2    ;d2 = Colour we are fading to.
  71. .f_mid    CALL    WaitVBL
  72.     CALL    PaletteToColour    ;Do the fade routine.
  73.     tst.w    d0    ;Has the fade finished yet?
  74.     bne.s    .f_mid    ;If not, keep doing it.
  75.  
  76.     moveq    #2,d1    ;d1 = Speed of fade.
  77.     move.l    #$a5F343,d2    ;d2 = Colour.
  78.     moveq    #$000000,d5    ;d5 = Colour.
  79. .f_out    CALL    WaitVBL
  80.     CALL    ColourMorph    ;Do the fade routine.
  81.     tst.w    d0    ;Has the fade finished yet?
  82.     bne.s    .f_out    ;If not, keep doing it.
  83.     rts
  84.  
  85. ;===========================================================================;
  86. ;                                  DATA
  87. ;===========================================================================;
  88.  
  89. ScreenTags:
  90.     dc.l    TAGS_GAMESCREEN
  91. Screen:    dc.l    0
  92.     dc.l    GSA_MemPtr1
  93. GMem:    dc.l    0
  94.     dc.l    GSA_AmtColours,32
  95.     dc.l    GSA_ScrWidth,320
  96.     dc.l    GSA_ScrHeight,256
  97.     dc.l    TAGEND
  98.  
  99. Picture    dc.l    0
  100.  
  101. PicFile    dc.b    "GMS:demos/data/PIC.Loading",0
  102.     even
  103.  
  104.